package com.mes.cloud.common.auth;


import java.util.List;
import java.util.Set;

public class BffContext {

    public static final String PERMISSION_SET = "PERMISSION_SET";
    public static final String USER_INFO = "USER_INFO";
    public static final String POSITION = "POSITION";


    public static Set<String> getPermissionSet() {
        return (Set<String>) BaseContextHandler.get(PERMISSION_SET);
    }

    public static void setPermissionSet(Set<String> permissionSet) {
        BaseContextHandler.set(PERMISSION_SET, permissionSet);
    }

    public static UserInfo getUserInfo() {
        return (UserInfo) BaseContextHandler.get(USER_INFO);
    }

    public static void setUserInfo(UserInfo userInfo) {
        BaseContextHandler.set(USER_INFO, userInfo);
    }

    public static void setPositionList(List<Position> positionList){
        BaseContextHandler.set(POSITION, positionList);
    }

    public static List<Position> getPositionList(){
        return (List<Position>) BaseContextHandler.get(POSITION);
    }

    public static void clear() {
        BaseContextHandler.remove();
    }
}
